package cn.varton.proxy;

import cn.varton.EventListener;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MouseHandler extends EventListener implements InvocationHandler{
    private Object target;

    public MouseHandler(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        method.invoke(target,args);
        System.out.println(method.getName());
        this.addListen(method.getName());
        this.trigger(method.getName());
        return null;
    }
}
